<?php
declare(strict_types=1);
namespace Field;

class SysPagesContentConst
{
    public const pk='';
    public const index=['PageID'];
	public const fields=['PageID','Thumbs','Brief','Content'];
	public const comment=['PageID'=>'PageId','Thumbs'=>'','Brief'=>'','Content'=>''];
	/*
    * @Field PageID
    * @Type int(11)
    * @Collation 
    * @Null NO
    * @Key PRI
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment PageId
    */
    public const PageID = 'PageID';
    /*
    * @Field Thumbs
    * @Type varchar(600)
    * @Collation utf8mb4_general_ci
    * @Null NO
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const Thumbs = 'Thumbs';
    /*
    * @Field Brief
    * @Type varchar(240)
    * @Collation utf8mb4_general_ci
    * @Null NO
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const Brief = 'Brief';
    /*
    * @Field Content
    * @Type text
    * @Collation utf8mb4_general_ci
    * @Null NO
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const Content = 'Content';
}

class SysPagesContentColumns
{
public  int $PageID;
   public  string $Thumbs;
   public  string $Brief;
   public  string $Content;
	public function toArray():array
	{
		return [
'PageID'=>$this->PageID,
    'Thumbs'=>$this->Thumbs,
    'Brief'=>$this->Brief,
    'Content'=>$this->Content,        ];
	}
}

class SysPagesContentRow
{
	public SysPagesContentColumns $data;
	public function toArray():array
	{
		return $this->data->toArray();
    }

    public function getValue(string $field):string|int|null
    {
        return match ($field){
        'PageID' => $this->data->PageID,
        'Thumbs' => $this->data->Thumbs,
        'Brief' => $this->data->Brief,
        'Content' => $this->data->Content, default=>null
        };
    }

    public function __construct(array $data)
    {
        $this->data = new SysPagesContentColumns();
        isset($data['PageID']) && $this->data->PageID = (int)$data['PageID'];
           isset($data['Thumbs']) && $this->data->Thumbs = (string)$data['Thumbs'];
           isset($data['Brief']) && $this->data->Brief = (string)$data['Brief'];
           isset($data['Content']) && $this->data->Content = (string)$data['Content'];
    }
}
?>